import path from 'path'
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";


import Components from '@uni-helper/vite-plugin-uni-components'
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig(async() => {
	const UnoCss = await import('unocss/vite').then(i => i.default)
	return {
		plugins: [
			// make sure put it before `Uni()`
			Components({
				resolvers: [WotResolver()]
			}),
			uni(),
			UnoCss()
		],
		resolve: {
			alias: {
				'@': path.resolve(__dirname, 'src'),
				'@img': path.resolve(__dirname, 'src/static/images'),
				'@page': path.resolve(__dirname, 'src/pages'),
				'@modules': path.resolve(__dirname, 'node_modules'),
			},
		}
	}

});